#include "ReadFAttribA.h"

CReadFAttribA::CReadFAttribA(char *ifName)
{
	fName=ifName;
}

CReadFAttribA::~CReadFAttribA()
{
}

int CReadFAttribA::ReadFile()
{
	ifstream ElleFile;
	ElleFile.open(fName);
	
	ElleFile>>readBuffer;
	while (!ElleFile.eof())
	{
		if (readBuffer=="F_ATTRIB_A")
		{
			cout<<readBuffer<<endl;
			
			ElleFile>>readBuffer;
			ElleFile>>defaultAttrib;
			cout<<"Default Attrib: "<<defaultAttrib<<endl;
			ElleFile>>readBuffer;
						
			while ((readBuffer!="OPTIONS")
				&&(readBuffer!="FLYNNS")
				&&(readBuffer!="LOCATION")
				&&(ElleFile!=NULL))
			{	
				cout<<"Attrib number: "<<readBuffer<<endl;
				//
				getline(ElleFile, readBuffer);
				istringstream attribNum(readBuffer);
				double temp;
				while (!attribNum.eof())
				{
					attribNum>>temp;
					cout<<temp<<" ";
				}
				cout<<endl;

				ElleFile>>readBuffer;
			}
		}
		ElleFile>>readBuffer;
	}
	
	ElleFile.close();
	return 0;
}
 
